@extends('layouts.app')
@include('shop.sidebar')
@section('content')
    <div class="content">
        <div class="row custom-invoice">
            <p style="margin: 10px; font-weight: bold;">店铺：{{$shop->name}}</p>
            @can('shop_store_member_add')
                <a class="btn btn-success" href="{{ route("admin.shop.member.create", ['id' => $shop->id]) }}">添加会员</a>
            @endcan
            <br/>
            <br/>
            <form class="form form-inline" method="get" action="{{ route('admin.shop.member', ['id' => $shop->id]) }}">
                <div class="form-group">
                    <input class="form-control" type="text" name="search" id="" value="{{ $search }}" placeholder="昵称">
                </div>
                <button type="submit" class="btn btn-success" value="">搜索</button>
                @can('shop_store_member_export')
                    <button type="submit" class="btn btn-primary" name="export" value="1">导出</button>
                @endcan
            </form>
            <table class="table table-striped table-hover">
                <thead>
                <tr>
                    <th>会员昵称</th>
                    <th>头像</th>
                    <th>会员真实姓名</th>
                    <th>电话</th>
                    <th>奖金池</th>
                    <th>已解锁</th>
                </tr>
                </thead>
                <tbody>
                @foreach($data as $item)
                    <tr>
                        <td>{{ $item->nickname }}</td>
                        <td>
                            <img src="{{ $item->avatar }}" width="30"/>
                        </td>
                        <td>{{ $item->name }}</td>
                        <td>{{ $item->mobile  }}</td>
                        <td>{{ $item->quota/100  }}</td>
                        <td>{{ $item->rebate/100  }}</td>
                    </tr>
                @endforeach
                </tbody>
            </table>
            {{ $data->appends(['search' => $search])->links() }}
        </div>
    </div>
@endsection
